<?php
/**
 * Array extended - the other functions
 *
 * As was necessary create new function, we combine this in this set of new
 * function for extend capabilities to PHP.  This set include special routines
 * necessary for other core scripts as XML-simple parser.
 *
 * @category  core
 * @package   CORE
 * @author    Juan Manuel Lemus <juan.lemus@apperture.org>
 * @copyright (c) 2008 by Apperture, Inc 
 * @license   http://www.apperture.org/es/licenses/apperture/gnugpl-3.0
 * @version   CVS: $Id: array.php,v 0.001 2008/03/10 13:05:00 cellog Exp $
 * @link      http://download.apperture.org/multi-purpose/core.tar.gz
 **/

function array_keys_list($array, $separator = '[%key%]', $parentkey = NULL)
{
    $keylist = array();
    
    foreach($array as $key => $values) {
       if ( !is_numeric($key) or is_array($values) ) {
            $key       = $parentkey . str_replace("%key%", $key, $separator);    
            $keylist[] = $key;
            
            if (is_array($values)) $keylist = array_merge($keylist, array_keys_list($values, $separator, $key) ); 
       }
    }
    
    return $keylist;
}
?>